package com.atguigu.exam.service;

import com.atguigu.exam.entity.ExamRecord;
import com.atguigu.exam.vo.ExamRankingVO;
import com.atguigu.exam.vo.StartExamVo;
import com.atguigu.exam.vo.SubmitAnswerVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 考试服务接口
 */
public interface ExamService extends IService<ExamRecord> {

    /**
     * 开始考试
     * @param startExamVo
     * @return
     */
    ExamRecord startExam(StartExamVo startExamVo);

    /**
     * 获取考试记录详情
     * @param id
     * @return
     */
    ExamRecord getExamRecordDetailById(Integer id);

    /**
     * 提交答案
     * @param examRecordId 考试记录ID
     * @param answers 答案列表
     * @return 考试记录
     */
    void submitAnswers(Integer examRecordId, List<SubmitAnswerVo> answers) throws InterruptedException;

    /**
     * ai书卷批阅功能
     * @param examRecordId
     * return
     */
    ExamRecord gradeExam(Integer examRecordId) throws InterruptedException;


    /**
     * 自定义删除考试记录
     * @param id 考试记录ID
     */
    void customRemoveById(Integer id);


    /**
     * 查询排行榜业务
     * @param paperId
     * @param limit
     * @return
     */
    List<ExamRankingVO> customGetRanking(Integer paperId, Integer limit);
}